//
//  NSObject+Propertys.m
//  ICrEAM
//
//  Created by mac on 16/11/18.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "NSObject+Propertys.h"

@implementation NSObject (Propertys)
-(NSArray *)getPropertyArray{
 
    unsigned count;
    NSMutableArray *arr=[NSMutableArray array];
    objc_property_t *propertys= class_copyPropertyList([self class], &count);
    for (int i=0; i<count; i++) {
        objc_property_t property=propertys[i];
        NSString *key=[NSString stringWithUTF8String:property_getName(property)];
                id obj=[self valueForKey:key];
                if ([obj isKindOfClass:[NSString class]]) {
                    NSString *str=obj;
                    if (IsStrEmpty(str)) {
                        str=@"0";
                    }
                    [arr  addObject:str];
                }
  
    }
    return arr;
}
@end
